module Match
  class KeyExtractor
    def self.getKeys(src)
      keywords = []
      algor = RMMSeg::Algorithm.new(src)

      loop do
        tok = algor.next_token
        break if tok.nil?
        text = tok.text.strip
        keywords << text if text.length > 3 && !keywords.include?(text)
      end
      
      keywords << "t恤" if src.downcase.include? "t恤" #TODO 临时解决方法
      keywords
    end
    
  end
end
